home *** CD-ROM | disk | FTP | other *** search
- # SCCS Id: @(#)MakeGCC.utl 3.1 93/01/18
- # Copyright (c) NetHack PC Development Team 1992, 1993.
- # PC NetHack 3.1 Utilities Makefile for djgpp
- # Gnu gcc compiler for msdos
- #
- # For questios or comments: Kevins@ori.org
- #
- # In addition to your C compiler,
- #
- # if you want to change you will need a
- # files with suffix workalike for
- # .y yacc
- # .l lex
- #
- # Note that flex (lex) and bison (yacc) are included with the
- # djgpp distribution and work quite well. This makefile assumes
- # you have them installed correctly.
-
- #
- # Executables.
- # gcc and go32 dos extender
-
- CC = gcc
- STUB = f:\djgpp\bin\stub.exe # Protected mode stub for go32. Either
- LINK = gcc # stub.exe or go32.exe
- MAKEBIN = make
-
- #
- # Special libraries and how to link them in.
-
- LIBS = -lpc
-
- #
- # Yacc/Lex ... if you got 'em.
- #
-
- YACC = bison -y
- LEX = flex
-
- YTABC = y_tab.c
- YTABH = y_tab.h
- LEXYYC = lexyy.c
-
- #
- # Flags.
- #
-
- # Debugging
- # CFLAGS = -g -c -I../include
-
- CFLAGS = -I../include -c
- LFLAGS =
-
-
- #
- # Directories, gcc likes unix style directory specs
- #
-
- INCL = ../include
- DAT = ../dat
-
- # But we must use dos directory specs to find src files, so....
- SRC = ..\src
- DINCL = ..\include
-
- default: all
-
-
- #############################################################################
- #
- # nothing below this line should have to be changed
- #
-
- #
- # Utility Objects.
- #
-
- MAKESRC = makedefs.c
-
- SPLEVSRC = lev_yacc.c lev_$(LEX).c lev_main.c panic.c
-
- DGNCOMPSRC = dgn_yacc.c dgn_$(LEX).c dgn_main.c
-
- MAKEOBJS = makedefs.o monst.o objects.o
-
- SPLEVOBJS = lev_yacc.o lev_$(LEX).o lev_main.o alloc.o \
- monst.o objects.o panic.o \
- drawing.o decl.o
-
- DGNCOMPOBJS = dgn_yacc.o dgn_$(LEX).o dgn_main.o alloc.o \
- panic.o
-
- RECOVOBJS = recover.o
-
- #
- # Header Objects.
- #
-
- DGN_FILE_H = $(INCL)\align.h $(INCL)\dgn_file.h
- DUNGEON_H = $(INCL)\align.h $(INCL)\dungeon.h
- EMIN_H = $(DUNGEON_H) $(INCL)\emin.h
- EPRI_H = $(DUNGEON_H) $(INCL)\align.h $(INCL)\epri.h
- ESHK_H = $(DUNGEON_H) $(INCL)\eshk.h
- MONDATA_H = $(INCL)\align.h $(INCL)\mondata.h
- MONST_H = $(INCL)\align.h $(INCL)\monst.h
- PERMONST_H = $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\align.h \
- $(INCL)\permonst.h
- RM_H = $(INCL)\align.h $(INCL)\rm.h
- SP_LEV_H = $(INCL)\align.h $(INCL)\sp_lev.h
- VAULT_H = $(DUNGEON_H) $(INCL)\vault.h
- YOUPROP_H = $(PERMONST_H) $(MONDATA_H) $(INCL)\prop.h \
- $(INCL)\pm.h $(INCL)\youprop.h
- YOU_H = $(MONST_H) $(YOUPROP_H) $(INCL)\align.h \
- $(INCL)\attrib.h $(INCL)\you.h
- DISPLAY_H = $(MONDATA_H) $(INCL)\vision.h $(INCL)\display.h
- PCCONF_H = $(INCL)\micro.h $(INCL)\system.h $(INCL)\pcconf.h
- CONFIG_H = $(GLOBAL_H) $(INCL)\tradstdc.h $(INCL)\config.h
- DECL_H = $(YOU_H) $(INCL)\spell.h $(INCL)\color.h \
- $(INCL)\obj.h $(INCL)\onames.h $(INCL)\pm.h \
- $(INCL)\decl.h
- GLOBAL_H = $(PCCONF_H) $(INCL)\coord.h $(INCL)\global.h
- HACK_H = $(CONFIG_H) $(DUNGEON_H) $(DECL_H) \
- $(DISPLAY_H) $(INCL)\monsym.h $(INCL)\mkroom.h \
- $(INCL)\objclass.h $(INCL)\trap.h $(INCL)\flag.h \
- $(RM_H) $(INCL)\vision.h $(INCL)\wintype.h \
- $(INCL)\engrave.h $(INCL)\rect.h $(INCL)\extern.h \
- $(INCL)\trampoli.h $(INCL)\hack.h
-
-
-
- #
- # Make Rules.
- #
-
- .SUFFIXES: .exe .o .c .y .l
-
- .c.o:
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- #
- # Primary Targets.
- #
- all: utility.tag
-
- utility.tag: $(INCL)\trap.h $(INCL)\onames.h \
- $(INCL)\pm.h $(SRC)\monstr.c $(SRC)\vis_tab.c \
- lev_comp.exe dgn_comp.exe recover.exe
- echo utilities made > utility.tag
-
- clean:
- del *.o
- del *.map
-
- spotless: clean
- if exist utility.tag del utility.tag
- if exist makedefs.exe del makedefs.exe
- if exist lev_comp.exe del lev_comp.exe
- if exist dgn_comp.exe del dgn_comp.exe
- if exist recover.exe del recover.exe
- if exist $(INCL)\date.h del $(INCL)\date.h
- if exist $(INCL)\onames.h del $(INCL)\onames.h
- if exist $(INCL)\pm.h del $(INCL)\pm.h
- if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
- if exist $(SRC)\monstr.c del $(SRC)\monstr.c
- if exist $(SRC)\vis_tab.c del $(SRC)\vis_tab.c
-
- #
- # Secondary Targets.
- #
-
- $(INCL)\onames.h: makedefs.exe
- .\makedefs -o
-
- $(INCL)\pm.h: makedefs.exe
- .\makedefs -p
-
- $(SRC)\monstr.c: makedefs.exe
- .\makedefs -m
-
- $(SRC)\vis_tab.h: makedefs.exe
- .\makedefs -z
-
- $(SRC)\vis_tab.c: makedefs.exe
- .\makedefs -z
-
- #
- # Makedefs Stuff
- #
-
- makedefs.exe: $(MAKEOBJS)
- $(CC) $(LFLAGS) $(MAKEOBJS)
- copy /b $(STUB)+a.out $*.exe
- del a.out
-
- makedefs.o: $(CONFIG_H) $(PERMONST_H) $(INCL)\objclass.h \
- $(INCL)\monsym.h $(INCL)\qtext.h
-
- #
- # Level Compiler Dependencies
- #
-
- lev_comp.exe: $(SPLEVOBJS)
- $(CC) $(LFLAGS) $(SPLEVOBJS)
- copy /b $(STUB)+a.out $*.exe
- del a.out
-
- lev_yacc.o: $(HACK_H) $(SP_LEV_H) lev_yacc.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
-
- lev_$(LEX).o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h \
- lev_$(LEX).c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- lev_main.o: $(HACK_H)
-
- $(INCL)\lev_comp.h: lev_yacc.c
-
- lev_yacc.c: lev_comp.y
- $(YACC) -d lev_comp.y
- copy $(YTABC) lev_yacc.c
- copy $(YTABH) $(DINCL)\lev_comp.h
- del $(YTABC)
- del $(YTABH)
-
-
- lev_$(LEX).c: lev_comp.l
- $(LEX) lev_comp.l
- copy $(LEXYYC) lev_$(LEX).c
- del $(LEXYYC)
-
-
- #
- # Dungeon Dependencies
- #
-
- dgn_comp.exe: $(DGNCOMPOBJS)
- $(CC) $(LFLAGS) $(DGNCOMPOBJS)
- copy /b $(STUB)+a.out $*.exe
- del a.out
-
- dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) dgn_yacc.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- dgn_$(LEX).o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \
- dgn_$(LEX).c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- dgn_main.o: $(HACK_H)
-
- $(INCL)\dgn_comp.h: dgn_yacc.c
-
- dgn_yacc.c: dgn_comp.y
- $(YACC) -d dgn_comp.y
- copy $(YTABC) dgn_yacc.c
- copy $(YTABH) $(DINCL)\dgn_comp.h
- del $(YTABC)
- del $(YTABH)
-
- dgn_$(LEX).c: dgn_comp.l
- $(LEX) dgn_comp.l
- copy $(LEXYYC) dgn_$(LEX).c
- del $(LEXYYC)
-
- #
- # Recover Utility
- #
-
- recover.exe: $(RECOVOBJS)
- $(CC) $(LFLAGS) $*.o
- copy /b $(STUB)+a.out $*.exe
- del a.out
-
- recover.o: $(CONFIG_H) recover.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- #
- # Other Dependencies.
- #
-
- alloc.c: $(SRC)\$*.c
- copy $(SRC)\$*.c .
-
- alloc.o: $(CONFIG_H) alloc.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- drawing.c: $(SRC)\$*.c
- copy $(SRC)\$*.c .
-
- drawing.o: $(CONFIG_H) drawing.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- decl.c: $(SRC)\$*.c
- copy $(SRC)\$*.c .
-
- decl.o: $(CONFIG_H) decl.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- monst.c: $(SRC)\$*.c
- copy $(SRC)\$*.c .
-
- monst.o: $(CONFIG_H) $(PERMONST_H) $(ESHK_H) \
- $(EPRI_H) $(VAULT_H) $(INCL)\monsym.h \
- $(INCL)\color.h monst.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- objects.c: $(SRC)\$*.c
- copy $(SRC)\$*.c .
-
- objects.o: $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
- $(INCL)\prop.h $(INCL)\color.h objects.c
- $(CC) $(CFLAGS) -o$*.o $*.c
-
- panic.o: $(CONFIG_H)
-